package apis

import (
	"gitee.com/byx_darwin/ncloud-go/core"
	"gitee.com/byx_darwin/ncloud-go/core/net/consts"
)

type QueryTaskConditions struct {
	TaskID string `json:"task_id"`
}

type QueryTaskRequest struct {
	core.NCloudRequest
	QueryTaskConditions
}

func NewQueryTaskRequestWithParams(taskID string) *QueryTaskRequest {
	return &QueryTaskRequest{
		core.NCloudRequest{
			Path:   "/gateway/task",
			Method: consts.MethodGet,
		},
		QueryTaskConditions{
			TaskID: taskID,
		},
	}
}

type TcpTaskDetail struct {
	Region  string `json:"region"`
	Address string `json:"address"` //tcp 服务端地址
	UUID    string `json:"uuid"`    //边缘设备uuid
	Status  int8   `json:"status"`  //任务状态 0待处理 1 处理中 2 完成 3 失败
}
type QueryTcpTaskResult struct {
	List     []TcpTaskDetail `json:"details_list"`
	TaskID   string          `json:"task_id"`
	Schedule float64         `json:"schedule"` //完成进度
}
type QueryTcpTaskResponse struct {
	Code    int                `json:"code"`
	Msg     string             `json:"msg"`
	Data    QueryTcpTaskResult `json:"data"`
	TrackID string             `json:"track_id"`
}
